home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Telecom
/
STR-TERM-1.2.SRC.ARC
/
TERM MODE
(
.txt
)
next >
Wrap
Commodore BASIC
|
2019-04-13
|
5KB
|
181 lines
100 *= $8000
110 ;
120 .D TERM
130 ;-------------------------------
140 ;TERMINAL MODE FOR ST/R TERMINAL
150 ; V1.2
155 ; NOW INCLUDES IBM ANSI
160 ;-------------------------------
170 ;
180 DC = 51972
190 BU = 51973
200 TEMP = 51976
210 SI = 54272
220 OUTIT = 51997
230 CHKIN = $FFC6
240 CHKOUT = $FFC9
250 CLRCHN = $FFCC
260 PRINT = $FFD2
270 GETIN = $FFE4
280 PLOT = $FFF0
290 CLOSE = $FFC3
300 CHRIN = $FFCF
310 ;
320 JMP START
330 JMP UPLOAD
340 JMP DOWNLOAD
350 JMP ASCTOPET
360 JMP PETTOASC
370 ;
380 CA .BYTE 0
390 CG .BYTE 0
400 DU .BYTE 0
410 TRANS .BYTE 0
420 ANSI .BYTE 1
430 ;
440 START JSR CLRCHN:LDX #5:JSR CHKIN
450 JSR GETIN:STA TEMP:JSR CLRCHN
460 LDA TEMP:BEQ KEYBRD:LDX CG
470 BNE CGMDE:JSR ASCTOPET:STA TEMP
480 CGMDE CMP #7:BNE NOBELL
490 JSR BELL:JMP START
500 NOBELL CMP #12:BEQ CLEAR
510 CMP #27:BNE NOESC
520 LDA ANSI:BEQ NOESC
530 JSR ESC:JMP START+3
540 NOESC CMP #19:BNE NOCLEAR
550 CLEAR LDA #147:STA TEMP
560 NOCLEAR JSR OUTIT
570 JSR PRTCR
580 KEYBRD JSR GETIN
590 BEQ START+3:STA TEMP:LDA 653:CMP #5
600 BNE NOPW:PW RTS:NOPW LDA TEMP
610 CMP #7:BNE NOTBELL:JSR BELL
620 NOTBELL CMP #133:BEQ PW
630 CMP #134:BNE NOTF3
640 LDA DU:EOR #1:STA DU:LDA 1039:EOR #128:STA 1039:JMP START
650 NOTF3 CMP #135:BNE NOTF5
660 LDA BU:EOR #1:STA BU:LDA 1043:EOR #128:STA 1043
670 LDA #0:STA DC:LDA 1041:AND #127:STA 1041
680 LDA #1:JSR CLOSE:JMP START
690 NOTF5 CMP #136:BNE NOTF7
700 LDA CA:EOR #1:STA CA:LDA 1047:EOR #128:STA 1047:JMP START
710 NOTF7 CMP #137:BEQ PW
720 CMP #138:BNE NOTF4
730 LDA BU:EOR #1:STA BU:LDA 1043:EOR #128:STA 1043
740 LDA DC:EOR #1:STA DC:LDA 1041:EOR #128:STA 1041:JMP START
750 NOTF4 CMP #139:BNE NOTF6
760 LDA CG:EOR #1:STA CG:LDA 1045:EOR #128:STA 1045:JMP START
770 NOTF6 CMP #140:BEQ PW1
780 CMP #166:BEQ PW1
790 CMP #220:BEQ PW1
800 CMP #176:BNE PW2
810 PW1 JMP PW
820 PW2 LDX CA:BEQ NOCAPS
830 CMP #65:BCC NOCAPS
840 CMP #91:BCS NOCAPS
850 ORA #$80:STA TEMP
860 NOCAPS LDX DU:BEQ FULLDU
870 JSR OUTIT:JSR PRTCR
880 FULLDU LDX CG:BNE CGMDE2
890 LDA TEMP:JSR PETTOASC:STA TEMP
900 CGMDE2 LDX #5:JSR CHKOUT
910 LDA TEMP:JSR PRINT:JSR CLRCHN
920 JMP START
930 ;
940 PRTCR LDA #164:JSR PRINT
950 LDA #157:JSR PRINT:RTS
960 ;
970 ASCTOPET JSR BASICOUT
980 TAY:LDA $AE00,Y:STA TEMP
990 JSR BASICIN:RTS
1000 ;
1010 PETTOASC JSR BASICOUT
1020 TAY:LDA $AF00,Y:STA TEMP
1030 JSR BASICIN:RTS
1040 ;
1050 BASICOUT LDX #54:STX 1:RTS
1060 ;
1070 BASICIN LDX #55:STX 1:RTS
1080 ;
1090 BELL LDA #21:STA SI+4:LDX #$FF
1100 LOOP1 DEX:BNE LOOP1
1110 LDA #20:STA SI+4:RTS
1120 ;
1130 UPLOAD LDY #0:LDX #50:DEX:BNE UPLOAD+2
1140 LDX #1:JSR CHKIN:JSR CHRIN
1150 STA TEMP:LDA 144
1160 STA 2:JSR CLRCHN
1170 LDX #5:JSR CHKOUT:LDA TEMP
1180 STA $0400,Y
1190 INY:JSR PRINT:JSR CLRCHN:JSR GETIN
1200 CMP #3:BEQ ABORT:LDA 2:AND #64
1210 BEQ UPLOAD+2
1220 ;
1230 EOF LDX #5:JSR CHKOUT:LDY #10
1240 LDA #26:LOOP3 JSR PRINT
1250 DEY:BNE LOOP3:JSR CLRCHN:RTS
1260 ;
1270 DOWNLOAD LDY #0:LDX #5:JSR CHKIN
1280 LOOP4 JSR GETIN:CMP #0:BEQ LP2:STA TEMP
1290 JSR CLRCHN:LDA TEMP:CMP #26
1300 BEQ EOF:CMP #24:BEQ ABORT
1310 LDX TRANS:BEQ NOTRANS
1320 STY 2:JSR ASCTOPET:LDY 2:STA TEMP
1330 NOTRANS LDX #1:JSR CHKOUT:LDA TEMP
1340 STA $0400,Y:INY
1350 JSR PRINT:LP2 JSR CLRCHN:JSR GETIN
1360 CMP #3:BEQ ABORT:BNE DOWNLOAD+2
1370 ;
1380 ABORT LDX #5:JSR CHKOUT:LDY #10
1390 LDA #24:LOOP2 JSR PRINT
1400 DEY:BNE LOOP2:JSR CLRCHN:RTS
1410 ;
1420 ESC LDX #5:JSR CHKIN:LDA #0:STA AN
1430 TAY:STA ANAR,Y:LDA #32:JSR PRINT
1440 LDA #$9D:JSR PRINT
1450 LOOPD JSR KEYS:JSR GETIN:CMP #0:BEQ LOOPD
1460 LOOPE JSR KEYS:JSR GETIN:CMP #0:BEQ LOOPE
1470 STA TEMP:CMP #59:BNE LOOPE1
1480 INC AN:LDY AN:LDA #0:STA ANAR,Y:BEQ LOOPE
1490 LOOPE1 LDA CG:BNE LOOPE2
1500 LDA TEMP:JSR ASCTOPET:STA TEMP
1510 LOOPE2 LDA TEMP:CMP #"M
1520 BNE LOOPE5:JMP COL[176]S
1590 LOOPE5 CMP #193:BNE LOOPE6
1600 LDY #0:LDA ANAR,Y:TAY:LDA #145
1610 LOOPE5A JSR [153]:DEY:BNE LOOPE5A
1620 RTS:LOOPE6 CMP #194:BNE LOOPE7
1630 LDY #0:LDA ANAR,Y:TAY:LDA #17
1640 BNE LOOPE5A:LOOPE7 CMP #195
1650 BNE LOOPE8:LDY #0:LDA ANAR,Y:TAY
1660 LDA #29:BNE LOOPE5A
1670 LOOPE8 CMP #196:BNE LOOPF2
1680 LDY #0:LDA ANAR,Y:TAY:LDA #157
1690 BNE LOOPE5A
1740 LOOPF2 CMP #202:BNE LOOPF3:LDA #147
1750 JMP [153]:LOOPF3 CMP #$30
1760 BCC LOOPF4:CMP #$3A:BCS LOOPF4
1770 STA TEMP:LDY AN:LDA ANAR,Y
1780 STA $FB:ASL:ASL:ASL:CLC
1790 ADC $FB:CLC:ADC $FB:STA ANAR,Y
1800 LDA TEMP
1810 [175] #$0F:CLC:LDY AN:ADC ANAR,Y
1820 STA ANAR,Y:JMP LOOPE
1830 LOOPF4 RTS
1840 COL[176]S LDY #255:INY:LDA ANAR,Y
1850 CMP #29:BCC NCOL[176]
1860 SEC:SBC #30
1870 CMP #9:BCS NCOL[176]:TAX
1880 LDA [156]S,X:STA 646
1890 NCOL[176] CPY AN:BNE COL[176]S[170]2:RTS
1900 KEYS JSR [156]CHN:JSR [161]IN:CMP #0
1910 BEQ N[145]E:PLA:PLA:RTS
1920 N[145]E LDX #5:JSR CHKIN:RTS
1930 ;
1960 AN .BYTE 0
1970 [156]S .BYTE 0 2 5 7 6 4 3 1
1980 ANAR .BYTE 0 0 0 0 0 0 0 0 0 0
1990 ;
2000 .[128] TERM MODE